package com.ruoyi.procured.service;

import java.util.List;

import com.ruoyi.common.core.domain.ProcuredOrders;
import com.ruoyi.common.core.domain.TreeSelect;
import com.ruoyi.procured.domain.vo.ArrivedQuantityDetailsVO;
import com.ruoyi.procured.domain.vo.OrdersProductDTO;

/**
 * 采购订单Service接口
 * 
 * @author ruoyi
 * @date 2023-11-15
 */
public interface IProcuredOrdersService 
{
    /**
     * 查询采购订单
     * 
     * @param ordersId 采购订单主键
     * @return 采购订单
     */
    public ProcuredOrders selectProcuredOrdersByOrdersId(Long ordersId);

    /**
     * 查询采购订单列表
     * 
     * @param procuredOrders 采购订单
     * @return 采购订单集合
     */
    public List<ProcuredOrders> selectProcuredOrdersList(ProcuredOrders procuredOrders);

    /**
     * 查询采购订单列表，查询5条
     * @param procuredOrders
     * @return
     */
    public List<ProcuredOrders> selectProcuredOrdersByList(ProcuredOrders procuredOrders);

    /**
     * 新增采购订单
     * 
     * @param procuredOrders 采购订单
     * @return 结果
     */
    public int insertProcuredOrders(ProcuredOrders procuredOrders);

    /**
     * 修改采购订单
     * 
     * @param procuredOrders 采购订单
     * @return 结果
     */
    public int updateProcuredOrders(ProcuredOrders procuredOrders);

    /**
     * 批量删除采购订单
     * 
     * @param ordersIds 需要删除的采购订单主键集合
     * @return 结果
     */
    public int deleteProcuredOrdersByOrdersIds(Long[] ordersIds);

    /**
     * 删除采购订单信息
     * 
     * @param ordersId 采购订单主键
     * @return 结果
     */
    public int deleteProcuredOrdersByOrdersId(Long ordersId);

    /**
     * 查询要撤销下单的采购单号
     * @param planId
     * @return
     */
    public List<ProcuredOrders> selectProcuredOrdersPlanId(Long planId);

    /**
     * 查询总入库数
     * @param ordersId
     * @return
     */
    public int updateInboundNumber(Long ordersId);


    /**
     * 查询OEM树结构信息
     * @param procuredOrders 信息
     * @return 结果
     */
    public List<TreeSelect> selectProcuredOrdersTree(ProcuredOrders procuredOrders);

    /**
     * 构建前端所需要树结构
     *
     * @param procuredOrdersList oem列表
     * @return 结果
     */
    public List<ProcuredOrders> buildProcuredOrdersTree(List<ProcuredOrders> procuredOrdersList);

    /**
     * 构建前端所需要下拉树结构
     *
     * @param procuredOrdersList oem列表
     * @return 结果
     */
    public List<TreeSelect> buildProcuredOrdersTreeSelect(List<ProcuredOrders> procuredOrdersList);

    /**
     * 通过计划单号来查询供应商、采购人员
     * @param ordersId
     * @return
     */
    public ProcuredOrders selectOrdersNumber(String ordersId);

    /**
     * 添加快递单号
     * @param procuredOrders
     * @return
     */
    public int updateExpressNumber(ProcuredOrders procuredOrders);

    /**
     * 查询库存待到货量详细
     *
     * @param vo
     * @return
     */
    List<ArrivedQuantityDetailsVO> getArrivedQuantityDetails(ArrivedQuantityDetailsVO vo);
    /**
     * 查询该申请的采购订单数据（商品信息，入库，出库信息）
     * @param ordersId
     * @return
     */
    List<OrdersProductDTO> selectOrdersProductListByOrdersId(Long ordersId);
    /**
     * 撤回采购单订单
     * @return
     */
    int revokeProcuredOrders(Long procuredOrderId, String revokeRemark, String nickname);

    /**
     * 查询未被收货过的采购订单
     * @param procuredOrders
     * @return
     */
//    List<ProcuredOrders> selectProcuredUnreceivedOrders(ProcuredOrders procuredOrders);
}
